<script>
import http from './utils/http';
export default {
	data() {
		return {
			safeBottom: '',
			address:''
		};
	},
	onLaunch: function () {
		this.safeBottom = uni.getStorageSync('safeBottom') ? uni.getStorageSync('safeBottom') : uni.getSystemInfoSync().safeArea.bottom - uni.getSystemInfoSync().safeArea.height;
		if (!uni.getStorageSync('safeBottom')) {
			uni.setStorageSync('safeBottom', this.safeBottom);
		}
		http.get('index/getconfig').then((res) => {
			// this.globalData.config = res.data;
			uni.setStorageSync('config', res.data);
		});
		http.get('index/templateconfig').then((res) => {
			// this.globalData.templateconfig = res.data
			uni.setStorageSync('templateconfig', res.data);
		});
		// #ifdef MP-WEIXIN
				const res = wx.getMenuButtonBoundingClientRect()
				uni.setStorageSync('safeTop',res.top+res.height + 'px')
		// #endif
	},
	onShow: function () {
		console.log('App Show');
		http.getLocation().then((res) => {
				// this.address = res;
				// this.realAddress = res;
				uni.setStorageSync('address', res);
			}).catch((e) => {
				// this.address = e;
				uni.setStorageSync('address', res);
		});
	},
	onHide: function () {
		console.log('App Hide');
	}
};
</script>

<style lang="scss">
/*每个页面公共css */
@import 'uview-ui/index.scss';
@import '/common.scss';
</style>
